﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.ArtiklVrijednosti"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ArtiklVrijednostiEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// TextBox for the Tekstualno property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTekstualno;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Tekstualno property.
		/// </summary>
		protected System.Windows.Forms.Label uxTekstualnoLabel;
		
		/// <summary>
		/// TextBox for the CijeliBroj property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxCijeliBroj;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the CijeliBroj property.
		/// </summary>
		protected System.Windows.Forms.Label uxCijeliBrojLabel;
		
		/// <summary>
		/// TextBox for the RealanBroj property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxRealanBroj;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the RealanBroj property.
		/// </summary>
		protected System.Windows.Forms.Label uxRealanBrojLabel;
		
		/// <summary>
		/// DataTimePicker for the Datum property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxDatum;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Datum property.
		/// </summary>
		protected System.Windows.Forms.Label uxDatumLabel;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Slika property.
		/// </summary>
		protected System.Windows.Forms.Label uxSlikaLabel;
		
		/// <summary>
		/// ComboBox for the IDArtiklSpecifikacija property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDArtiklSpecifikacija;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDArtiklSpecifikacija property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDArtiklSpecifikacijaLabel;
		
		/// <summary>
		/// ComboBox for the IDArtikl property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDArtikl;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDArtikl property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDArtiklLabel;
		#endregion
		
		#region Main entity
		private Entities.ArtiklVrijednosti _ArtiklVrijednosti;
		/// <summary>
		/// Gets or sets the <see cref="Entities.ArtiklVrijednosti"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.ArtiklVrijednosti"/> instance.</value>
		public Entities.ArtiklVrijednosti ArtiklVrijednosti
		{
			get {return this._ArtiklVrijednosti;}
			set
			{
				this._ArtiklVrijednosti = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTekstualno.DataBindings.Clear();
			this.uxTekstualno.DataBindings.Add("Text", this.uxBindingSource, "Tekstualno", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxCijeliBroj.DataBindings.Clear();
			this.uxCijeliBroj.DataBindings.Add("Text", this.uxBindingSource, "CijeliBroj", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxRealanBroj.DataBindings.Clear();
			this.uxRealanBroj.DataBindings.Add("Text", this.uxBindingSource, "RealanBroj", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDatum.DataBindings.Clear();
			this.uxDatum.DataBindings.Add("Value", this.uxBindingSource, "Datum", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDArtiklSpecifikacija.DataBindings.Clear();
			this.uxIDArtiklSpecifikacija.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDArtiklSpecifikacija", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDArtikl.DataBindings.Clear();
			this.uxIDArtikl.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDArtikl", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ArtiklVrijednostiEditControlBase"/> class.
		/// </summary>
		public ArtiklVrijednostiEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_ArtiklVrijednosti != null) _ArtiklVrijednosti.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxTekstualno = new System.Windows.Forms.TextBox();
			uxTekstualnoLabel = new System.Windows.Forms.Label();
			this.uxCijeliBroj = new System.Windows.Forms.TextBox();
			uxCijeliBrojLabel = new System.Windows.Forms.Label();
			this.uxRealanBroj = new System.Windows.Forms.TextBox();
			uxRealanBrojLabel = new System.Windows.Forms.Label();
			this.uxDatum = new System.Windows.Forms.DateTimePicker();
			uxDatumLabel = new System.Windows.Forms.Label();
			uxSlikaLabel = new System.Windows.Forms.Label();
			this.uxIDArtiklSpecifikacija = new System.Windows.Forms.ComboBox();
			uxIDArtiklSpecifikacijaLabel = new System.Windows.Forms.Label();
			this.uxIDArtikl = new System.Windows.Forms.ComboBox();
			uxIDArtiklLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxTekstualnoLabel
			//
			this.uxTekstualnoLabel.Text = "Tekstualno:";
			this.uxTekstualnoLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxTekstualnoLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTekstualnoLabel);			
			//
			// uxTekstualno
			//
			this.uxTekstualno.Width = 250;
			this.uxTekstualno.MaxLength = 500;
			//this.uxTableLayoutPanel.Controls.Add(this.uxTekstualno);
			this.uxTekstualno.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxTekstualno);
			//
			// uxCijeliBrojLabel
			//
			this.uxCijeliBrojLabel.Text = "CijeliBroj:";
			this.uxCijeliBrojLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxCijeliBrojLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxCijeliBrojLabel);			
			//
			// uxCijeliBroj
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxCijeliBroj);
			this.uxCijeliBroj.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxCijeliBroj);
			//
			// uxRealanBrojLabel
			//
			this.uxRealanBrojLabel.Text = "RealanBroj:";
			this.uxRealanBrojLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxRealanBrojLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxRealanBrojLabel);			
			//
			// uxRealanBroj
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxRealanBroj);
			this.uxRealanBroj.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxRealanBroj);
			//
			// uxDatumLabel
			//
			this.uxDatumLabel.Text = "Datum:";
			this.uxDatumLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxDatumLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDatumLabel);			
			//
			// uxDatum
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDatum);
			this.uxDatum.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxDatum);
			//
			// uxIDArtiklSpecifikacijaLabel
			//
			this.uxIDArtiklSpecifikacijaLabel.Text = "IDArtiklSpecifikacija:";
			this.uxIDArtiklSpecifikacijaLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxIDArtiklSpecifikacijaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDArtiklSpecifikacijaLabel);			
			//
			// uxIDArtiklSpecifikacija
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDArtiklSpecifikacija);
			this.uxIDArtiklSpecifikacija.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxIDArtiklSpecifikacija);
			//
			// uxIDArtiklLabel
			//
			this.uxIDArtiklLabel.Text = "IDArtikl:";
			this.uxIDArtiklLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxIDArtiklLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDArtiklLabel);			
			//
			// uxIDArtikl
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDArtikl);
			this.uxIDArtikl.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxIDArtikl);
			//
			// uxIDArtikl
			//				
			this.uxIDArtikl.DisplayMember = "Naziv";	
			this.uxIDArtikl.ValueMember = "ID";	
			//
			// uxIDArtiklSpecifikacija
			//				
			this.uxIDArtiklSpecifikacija.DisplayMember = "Naziv";	
			this.uxIDArtiklSpecifikacija.ValueMember = "ID";	
			// 
			// ArtiklVrijednostiEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ArtiklVrijednostiEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Artikl> _IDArtiklList;
		
		/// <summary>
		/// The ComboBox associated with the IDArtikl property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Artikl> IDArtiklList
		{
			get {return _IDArtiklList;}
			set 
			{
				this._IDArtiklList = value;
				this.uxIDArtikl.DataSource = null;
				this.uxIDArtikl.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDArtiklList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDArtikl property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDArtiklList
		{
			get { return _allowNewItemInIDArtiklList;}
			set
			{
				this._allowNewItemInIDArtiklList = value;
				this.uxIDArtikl.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.ArtiklSpecifikacija> _IDArtiklSpecifikacijaList;
		
		/// <summary>
		/// The ComboBox associated with the IDArtiklSpecifikacija property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.ArtiklSpecifikacija> IDArtiklSpecifikacijaList
		{
			get {return _IDArtiklSpecifikacijaList;}
			set 
			{
				this._IDArtiklSpecifikacijaList = value;
				this.uxIDArtiklSpecifikacija.DataSource = null;
				this.uxIDArtiklSpecifikacija.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDArtiklSpecifikacijaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDArtiklSpecifikacija property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDArtiklSpecifikacijaList
		{
			get { return _allowNewItemInIDArtiklSpecifikacijaList;}
			set
			{
				this._allowNewItemInIDArtiklSpecifikacijaList = value;
				this.uxIDArtiklSpecifikacija.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
